/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package org.shiep.aurora.calendar;

import javax.swing.JFrame;
import work02.w5.control.MyCalendar;
import work02.w5.control.Schedule;
import work02.w5.control.server.Toast;

/**
 *
 * @author Eric
 */
public class UIManager {

    static SchedulePanel scheduleP;
    static BackGround background;

    public static SchedulePanel getSchedulePanel() {
        return scheduleP;
    }
    private CalendarFrameAdapter cal;

    public UIManager() {
        background = new BackGround();
        cal = new CalendarFrameAdapter();
        scheduleP = new SchedulePanel();
        SchedulePanelAdapter sc = new SchedulePanelAdapter();
        Schedule sche = new Schedule();
        MyCalendar myCal = new MyCalendar();
        background.IOC(cal);
        cal.IOC(background, myCal, sche);
        sc.IOC();
        scheduleP.IOC(sc, sche, cal);
        cal.setCalendarPresentTime();

    }

    public void startUI() {
        BaseFrame frame = new BaseFrame(background);
        frame.setFocusable(true);
        frame.setVisible(true);
        frame.setSize(470, 520);
        background.setVisible(true);
        frame.addMoreListener();
    }

    public static void main(String arg[]) {
        Toast.startService();
        new UIManager().startUI();
    }
}
